/*
*  gmain.h - Vobri 'main' window
*  Copyright (c) 2005 Derek Ingrouville (dergro@users.sourceforge.net)
*
*  This program is free software; you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; either version 2 of the License, or
*  (at your option) any later version.
*
*  This program is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU Library General Public License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with this program; if not, write to the Free Software
*  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

#ifndef _GMAIN_H
#define _GMAIN_H

#include <gtk/gtk.h>

typedef struct _GMainWindow GMainWindow;

#include "glogin.h"
#include "gclist.h"
#include "gconvo.h"


typedef enum _GMainState
{
    GMAIN_STATE_LOGIN = 0,
    GMAIN_STATE_ACTIVE,
    GMAIN_STATE_INVALID
} GMainState;

typedef struct _GMainWindowLogin
{
	GtkAlignment *alignment;
	GtkWidget *eventbox;
	GtkLabel *label;
} GMainWindowLogin;

typedef struct _GMainWindowActive
{
	GtkVBox *vbox;
	GtkLabel *dispname;
	GCList *gclist;
	GList *convos;
	MsnSession *session;
} GMainWindowActive;

struct _GMainWindow
{
	GtkWindow *window;

	/* Menu stuff */
	GtkMenuBar *menubar;
	GtkUIManager *ui_manager;
	GtkAccelGroup *accel_group;

	/* Area below menubar */
	GtkWidget *action_area;		/* This windows action area */
	GtkWidget *action_widget;	/* Widget (usually container) packed into action area */
	
	GMainWindowLogin  *login;	/* Widgets used in login state */
	GMainWindowActive *active;	/* Widgets used in active state (signed in) */
	GMainState state;
};

GMainWindow *gmain_window_new ();
void gmain_window_reset (GMainWindow *gmain);
void gmain_window_close (GMainWindow *gmain);

void gmain_activate_appropriate_menus (GMainWindow *gmain);
void gmain_disable_appropriate_menus (GMainWindow *gmain);

int gmain_window_login_show (GMainWindow *gmain);
int gmain_window_clist_show (GMainWindow *gmain);

void gmain_window_add_convo (GMainWindow *gmain, GConvo *convo);
GConvo *gmain_window_find_convo_from_sboard (GMainWindow *gmain,
					     MsnSwitchboard *sboard);
GConvo *gmain_window_find_convo_with_participant (GMainWindow *gmain,
						  char *passport);
void gmain_window_update_user (GMainWindow *gmain);
void gmain_window_remove_convo (GMainWindow *gmain, GConvo *convo);
int gmain_window_convo_closed (GConvo *convo, GMainWindow *gmain);
void gmain_warn_all_convos_hidden_status (GMainWindow *gmain);

#endif /* _GMAIN_H */
